<?php

namespace App\Models\Scm;

use Illuminate\Database\Eloquent\Model;
use Log;
/**
 * author 叶文华
 * 采购同步结果
 */
class SyncRecord extends Model
{
    protected $table = 'scm_sync_record';
    protected $fillable = ['id', 'ids', 'type', 'result', 'status', 'created_at', 'updated_at'];

    protected $casts = [
        'created_at' => 'datetime:Y-m-d H:i:s',
        'updated_at' => 'datetime:Y-m-d H:i:s'
    ];

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
    }

    public function insertOne($params){
        return self::create($params);
    }

    public function insertMany($params){
        return self::insert($params);
    }

    public function findFailData(){
        return self::where('status', 'fail')->get();
    }
}

